Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

167
Visualizações
Push notification showing "This site has been updated in the background"

I have node.js web-push backend server sending push events to a ServiceWorker in the frontend, and the ServiceWorker shows a notification every time it receives a push event. However, instead of showing the notification that I programmed into the ServiceWorker, it is showing the default message "This site has been updated in the background."


Things I have tried: event.waitUntil(self.registration.showNotification(title, payload)),
return self.registration.showNotification(title, payload),
return new Promise((resolve,reject)=>{self.registration.showNotification(title, payload); resolve()}),
event.waitUntil(new Promise((resolve,reject)=>{self.registration.showNotification(title, payload); resolve()}))

(service-worker.js)

self.addEventListener('push', event => {
    const payload = {
        body: "Testing...",
        icon: "https://parity.cf/images/logo.png"
    };
    event.waitUntil(self.registration.showNotification("Sample Notification", payload));
});

I am going just a little bit crazy trying to figure this out, does anyone know what to do? Thanks in advance!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda